# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Lukas Jirkovsky <l.jirkovsky@gmail.com>
# Contributor: BlackEagle < ike DOT devolder AT gmail DOT com >
# Contributor: Dany Martineau <dany.luc.martineau at gmail.com>
# Contributor: Dylon Edwards <deltaecho@archlinux.us>

pkgname=kcm-wacomtablet
pkgver=3.2.0
pkgrel=7
epoch=1
pkgdesc='KDE GUI for the Wacom Linux Drivers'
arch=(loong64 x86_64)
url='https://invent.kde.org/kde/wacomtablet.git'
license=(GPL)
depends=(gcc-libs
         glibc
         kconfig5
         kconfigwidgets5
         kcoreaddons5
         kdbusaddons5
         kglobalaccel5
         ki18n5
         knotifications5
         kwidgetsaddons5
         kwindowsystem5
         kxmlgui5
         libwacom
         libxcb
         libxi
         plasma-framework5
         plasma-workspace
         qt5-base
         qt5-x11extras
         xf86-input-wacom)
makedepends=(extra-cmake-modules
             kdoctools5)
source=(https://download.kde.org/stable/wacomtablet/$pkgver/wacomtablet-$pkgver.tar.xz{,.sig}
        add_missing_includes.diff
        wacomtablet-qt5.15.patch::https://invent.kde.org/system/wacomtablet/-/commit/4f73ff02.patch)
sha256sums=('c80ce63a41f6fcbb50ac4c2130ed2f8273c4b744e62e33d4b714bf83e8e5f7a4'
            'SKIP'
            '143b2e81e5152c2f1db6e03089b32d9b9fdf1e61739743179b0efb299eb5b44d'
            '326fc3ab2ca022f8eeb91d8963664befd070980966a843410f2d16bd3a934da6')
validpgpkeys=('E6E4C916590026E45836A12EA8896AFDFEF5DF53') # Valeriy Malov

prepare() {
  patch -d wacomtablet-$pkgver -p1 -i ../add_missing_includes.diff
  patch -d wacomtablet-$pkgver -p1 -i ../wacomtablet-qt5.15.patch # Fix build with Qt 5.15
}

build() {
  cmake -B build -S wacomtablet-$pkgver \
    -DBUILD_TESTING=OFF
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build
}
